import {
  IEditorContainerController,
  IEditorProvider,
} from '@ibiz-template/runtime';
import { IPicker } from '@ibiz/model-core';
import { TransferPickerController } from './transfer-picker.controller';

/**
 * 数据选择器编辑器适配器
 *
 * @author lxm
 * @date 2022-09-19 22:09:03
 * @export
 * @class TransferPickerProvider
 * @implements {EditorProvider}
 */
export class TransferPickerProvider implements IEditorProvider {
  formEditor: string;

  gridEditor: string;

  constructor() {
    this.formEditor = 'IBizTransferPicker';
    this.gridEditor = 'IBizTransferPicker';
  }

  async createController(
    editorModel: IPicker,
    parentController: IEditorContainerController,
  ): Promise<TransferPickerController> {
    const c = new TransferPickerController(editorModel, parentController);
    await c.init();
    return c;
  }
}
